import { dialog } from 'electron'

export const selectDirectory = async () => {
  const res = dialog.showOpenDialog({
    title: '选择文件夹',
    properties: ['openDirectory', 'createDirectory']
  })
  return (await res).canceled === false ? (await res).filePaths[0] : ''
}
